<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<!--MyHeader-->
<div th:fragment="MyHeader">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="DGUT选课系统">
    <meta name="author" content="yuec">

    <title>选课系统</title>

    <!-- Custom fonts for this template-->
    <link href="/vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i"
          rel="stylesheet">
    <!-- Custom styles for this template-->
    <link href="/css/sb-admin-2.min.css" rel="stylesheet">
    <link href="/webjars/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="/vendor/jquery/jquery.min.js"></script>


</div>
<!-- End of MyHeader -->

<!-- Sidebar -->
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar"
    th:fragment="Sidebar(loginName,userType)">

    <!-- Sidebar - Brand -->
    <a class="sidebar-brand d-flex align-items-center justify-content-center" href="/index">
        <div class="sidebar-brand-icon rotate-n-15">
            <i class="fas fa-laugh-wink"></i>
        </div>
        <div class="sidebar-brand-text mx-3">[[${loginName}]]<sup>[[${userType}]]</sup></div>
    </a>

    <!-- Divider -->
    <hr class="sidebar-divider my-0">

    <!-- Nav Item - Dashboard -->
    <li class="nav-item active">
        <a class="nav-link" href="/index">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>首页</span></a>
    </li>

    <!-- 分割 -->
    <hr class="sidebar-divider">

    <!-- Heading -->
    <div class="sidebar-heading">
        选课管理
    </div>

    <!-- Nav Item - Pages Collapse Menu -->
    <li class="nav-item">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsePages"
           aria-expanded="true" aria-controls="collapsePages">
            <i class="fas fa-fw fa-folder"></i>
            <span>选课系统</span>
        </a>
        <div id="collapsePages" class="collapse" aria-labelledby="headingPages" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header" >选课/参加活动:</h6>
                <a class="collapse-item" href="/course/choose" >选修课程</a>
                <a class="collapse-item" href="/activities/choose" >报名活动</a>
                <a class="collapse-item" href="/course/myLog" >选报记录</a>
                <h6 class="collapse-header" >查询管理:</h6>
                <a class="collapse-item" href="/course/history" >课程查询</a>
                <a class="collapse-item" href="/activities/history" >活动记录</a>
                <div class="collapse-divider" shiro:lacksRole="student"></div>
                <h6 class="collapse-header" shiro:lacksRole="student">新增/创建:</h6>
                <a class="collapse-item" href="/course/create" shiro:lacksRole="student">新增课程</a>
                <a class="collapse-item" href="/activities/create" shiro:lacksRole="student">创建活动</a>
            </div>
        </div>
    </li>

    <!-- 分割 -->
    <hr class="sidebar-divider" shiro:hasRole="admin">

    <!-- Heading -->
    <div class="sidebar-heading" shiro:hasRole="admin">
        人员管理
    </div>

    <!--教师模块-->
    <li class="nav-item" shiro:hasRole="admin">
        <a class="nav-link" href="/user/teachManage" id="teacherModel">
            <i class="fas fa-fw fa-chart-area"></i>
            <span>教师管理模块</span></a>
    </li>

    <!--学生模块-->
    <li class="nav-item" shiro:hasRole="admin">
        <a class="nav-link" href="/user/stuManage" id="studentModel">
            <i class="fas fa-fw fa-chart-area"></i>
            <span>学生管理模块</span></a>
    </li>


    <!-- 分割 -->
    <hr class="sidebar-divider">

    <!-- Heading -->
    <div class="sidebar-heading">
        通知管理
    </div>

    <!-- Nav Item - Pages Collapse Menu -->
    <li class="nav-item">
        <a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#noticeManagement"
           aria-expanded="true" aria-controls="noticeManagement">
            <i class="fas fa-fw fa-cog"></i>
            <span>公告通知</span>
        </a>
        <div id="noticeManagement" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
            <div class="bg-white py-2 collapse-inner rounded">
                <h6 class="collapse-header">公告通知:</h6>
                <a class="collapse-item" href="/notice/history">查询系统</a>
                <a class="collapse-item" href="/notice/create" shiro:lacksRole="student">发布新公告</a>
            </div>
        </div>
    </li>


    <!--学校机构-->
    <li class="nav-item" shiro:hasRole="admin">
        <a class="nav-link" href="/dept" id="deptManage">
            <i class="fas fa-fw fa-chart-area"></i>
            <span>学校机构</span></a>
    </li>

    <!-- Divider -->
    <hr class="sidebar-divider d-none d-md-block">


    <!-- Sidebar Toggler (Sidebar) -->
    <div class="text-center d-none d-md-inline">
        <button class="rounded-circle border-0" id="sidebarToggle"></button>
    </div>

</ul>
</ul>
<!-- End of Sidebar -->

<!-- Topbar -->
<div th:fragment="Topbar(userName)">
    <nav class="navbar navbar-expand navbar-light bg-white topbar mb-4 static-top shadow">

        <!-- Sidebar Toggle (Topbar) -->
        <button id="sidebarToggleTop" class="btn btn-link d-md-none rounded-circle mr-3">
            <i class="fa fa-bars"></i>
        </button>

        <!-- Topbar Search -->
        <form class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
            <div class="input-group">
                <input type="text" class="form-control bg-light border-0 small" placeholder="Search for..."
                       aria-label="Search" aria-describedby="basic-addon2">
                <div class="input-group-append">
                    <button class="btn btn-primary" type="button">
                        <i class="fas fa-search fa-sm"></i>
                    </button>
                </div>
            </div>
        </form>

        <!-- Topbar Navbar -->
        <ul class="navbar-nav ml-auto">

            <!-- Nav Item - Search Dropdown (Visible Only XS) -->
            <li class="nav-item dropdown no-arrow d-sm-none">
                <a class="nav-link dropdown-toggle" href="#" id="searchDropdown" role="button" data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">
                    <i class="fas fa-search fa-fw"></i>
                </a>
                <!-- Dropdown - Messages -->
                <div class="dropdown-menu dropdown-menu-right p-3 shadow animated--grow-in"
                     aria-labelledby="searchDropdown">
                    <form class="form-inline mr-auto w-100 navbar-search">
                        <div class="input-group">
                            <input type="text" class="form-control bg-light border-0 small" placeholder="Search for..."
                                   aria-label="Search" aria-describedby="basic-addon2">
                            <div class="input-group-append">
                                <button class="btn btn-primary" type="button">
                                    <i class="fas fa-search fa-sm"></i>
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </li>

            <div class="topbar-divider d-none d-sm-block"></div>

            <!-- Nav Item - User Information -->
            <li class="nav-item dropdown no-arrow">
                <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown"
                   aria-haspopup="true" aria-expanded="false">
                    <span class="mr-2 d-none d-lg-inline text-gray-600 small">[[${userName}]]</span>
                    <svg width="2em" height="2em" viewBox="0 0 16 16" class="bi bi-person-circle" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
                        <path d="M13.468 12.37C12.758 11.226 11.195 10 8 10s-4.757 1.225-5.468 2.37A6.987 6.987 0 0 0 8 15a6.987 6.987 0 0 0 5.468-2.63z"/>
                        <path fill-rule="evenodd" d="M8 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/>
                        <path fill-rule="evenodd" d="M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8z"/>
                    </svg>
<!--                    <img class="img-profile rounded-circle" src="/img/profile.jpg">-->
                </a>
                <!-- Dropdown - User Information -->
                <div class="dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="userDropdown">
                    <a class="dropdown-item" href="/index">
                        <i class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>
                        个人信息
                    </a>
                    <a class="dropdown-item" href="/course/myLog">
                        <i class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>
                        选课历史
                    </a>
                    <a class="dropdown-item" href="/notice/history">
                        <i class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>
                        查看公告
                    </a>
                    <div class="dropdown-divider"></div>
                    <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">
                        <i class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>
                        登出
                    </a>
                </div>
            </li>

        </ul>

    </nav>
</div>
<!-- End of Topbar -->

<!-- Footer -->
<div th:fragment="Footer">
    <footer class="sticky-footer bg-white">
        <div class="container my-auto">
            <div class="copyright text-center my-auto">
                <span>Copyright &copy; 刘岳烯|yuec</span>
            </div>
        </div>
    </footer>
</div>
<!-- End of Footer -->

<!-- Logout Modal-->
<div th:fragment="LogoutModal">
    <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
         aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">Ready to Leave?</h5>
                    <button class="close" type="button" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body">是否确定退出当前DGUT选课系统.</div>
                <div class="modal-footer">
                    <button class="btn btn-secondary" type="button" data-dismiss="modal">取消</button>
                    <a class="btn btn-primary" href="/logout">退出</a>
                </div>
            </div>
        </div>
    </div>
    <!-- Bootstrap core JavaScript-->
    <script src="/webjars/bootstrap/4.0.0/js/bootstrap.min.js"></script>
    <script src="/vendor/bootstrap/js/bootstrap.bundle.min.js"></script>

    <!-- Core plugin JavaScript-->
    <script src="/vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="/js/sb-admin-2.min.js"></script>

    <!-- End of Logout Modal -->
</div>


</html>